#!/usr/local/bin/python3
__author__ = '曹植'

from sshtunnel import SSHTunnelForwarder
import pymysql
import os


class BaseSql:
    # 本地测试数据库连接
    # def __init__(self):
    #     self.conn = pymysql.connect(host='192.168.1.221',
    #                                 port=13306,
    #                                 user='axh_test',  # 数据库用户
    #                                 password='axh123',  # 数据库密码
    #                                 db='ffpt',  # 数据库名
    #                                 charset='utf8')
    #     self.cursor = self.conn.cursor()

    # 线上数据库连接
    def __init__(self):
        self.conn = pymysql.connect(host='rm-wz93jbhtjb28ff2warw.mysql.rds.aliyuncs.com',
                                    port=3306,
                                    user='ffpt',  # 数据库用户
                                    password='MmVhpg8D6Z7R7cR',  # 数据库密码
                                    db='ffpt_88pxh',  # 数据库名
                                    charset='utf8')
        self.cursor = self.conn.cursor()

    def close(self):
        self.conn.close()